<template>
  <div>
    <div class="fill"></div>
    <div class="topBackBox" :class="{ topBackBoxAbsolute: boxStyle }" :style="css">
      <img class="topBackImg" :style="cssLImg" :src="imgLUrl" alt="" @click="goBack()" />
      <span class="topBackTextC" :style="cssTextC">{{ textContent }}</span>
      <span class="topBackTextR" :style="cssTextR" v-if="textRight">{{ textRight }}</span>
    </div>
  </div>
</template>

<script>
export default {
  name: "TopBack",
  data() {
    return {};
  },
  props: {
    imgLUrl: {
      type: String,
      default: require("@/assets/zfc-img/左箭头.png"),
    },
    textContent: {
      type: String,
      default: "面部护理",
    },
    textRight: {
      type: String,
      default: "",
    },
    boxStyle: {
      type: Boolean,
      default: false,
    },
    css: {
      default: "",
    },
    cssTextC: {
      default: "",
    },
    cssTextR: {
      default: "",
    },
    cssLImg: {
      default: "",
    },
  },
  methods: {
    goBack() {
      history.back();
    },
  },
};
</script>

<style scoped>
.fill {
  padding-top: 0.96rem;
}
.topBackBox {
  width: 100%;
  height: 0.96rem;
  background-color: #e53e42;
  display: flex;
  align-items: center;
  justify-content: center;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 999;
}
.topBackImg {
  width: 0.22rem;
  height: 0.38rem;
  position: absolute;
  top: 0.29rem;
  left: 0.2rem;
}
.topBackTextC {
  height: 0.36rem;
  line-height: 0.36rem;
  white-space: nowrap;
  text-overflow: ellipsis;
  overflow: hidden;
  font-size: 0.36rem;
  color: #ffffff;
}
.topBackTextR {
  height: 100%;
  font-size: 0.3rem;
  color: #4c4c4c;
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: 0;
  right: 0.2rem;
}
.topBackBoxAbsolute {
  position: absolute;
}
</style>
